#!/usr/bin/env python
# coding: utf-8

import matplotlib.pyplot as plt
import pandas as pd
import json
class Graph():
    def plotxy(self, queue,title):
        if queue.empty():
            print('请重新发送一遍！！！')
        else:
            data = queue.get()
            df = pd.DataFrame(data)
            df.year = pd.to_datetime(df.year)
            df.value = pd.to_numeric(df.value)
            df.set_index(df.year,inplace=True)
            plt.title(title)
            df.value.plot()
            plt.show()